<?php $baseUrl=Zend_Controller_Front::getInstance()->getBaseUrl(); ?>

<div class="header">
    <h4>Sự kiện</h4>
</div>
<div>
    <table class="comment" width="100%" cellspacing="0" cellpadding="5px">
        <?php
            foreach($this->event as $event)
            {
        ?>
        <tr>
            <td width="60px">
                <img class="avatar" alt="" src="<?php echo $event["user_image"];?>" />
            </td>
            <td>
                <a class="menu" href="<?php echo $baseUrl .'/community/event/detail?id='.$event["_id"]; ?>"><?php echo $event["title"]; ?></a>
               <br/><br/>
               <div style="float:left;">
                   <?php echo 'Viết vào lúc '.$event["date"]; ?>
               </div>
               <div style="float:right;">
                   <?php
                       if((int)$event["view"] >0)
                           echo $event["view"].' lượt xem';
                       if((int)$event["sumcomment"] >0)
                           echo ' | '.$event["view"].' lời bình ';
                   ?>
               </div>
            </td>
        </tr>
        <?php
            }
        ?>
    </table>
</div>
<div class="clear"></div>

<div class="header">
    <h4>Cảm nhận</h4>
</div>
<div>
    <table class="comment" width="100%" cellspacing="0" cellpadding="5px">
        <?php
            foreach($this->comment as $comment)
            {
        ?>
        <tr>
            <td width="60px">
                <img class="avatar" alt="" src="<?php echo $comment["image"];?>" />
            </td>
            <td>
                <a class="menu" href="<?php echo $baseUrl .'/default/book/detail?id='.$comment["_id"]; ?>"><?php echo $comment["content"]; ?></a>
               <br/><br/>
               <div style="float:left;">
                   <?php echo 'Bình luận vào lúc '.$comment["date"]; ?>
               </div>
               <div style="float:right;">
                   <?php
                       if((int)$comment["view"] >0)
                           echo $comment["view"].' lượt xem';
                       if((int)$comment["sumcomment"] >0)
                           echo ' | '.$comment["view"].' lời bình ';
                   ?>
               </div>
            </td>
        </tr>
        <?php
            }
        ?>
    </table>
</div>
<div class="clear"></div>

<div class="header">
    <h4>Bài viết</h4>
</div>
<div>
    <table class="comment" width="100%" cellspacing="0" cellpadding="5px">
        <?php
            foreach($this->story as $story)
            {
        ?>
        <tr>
            <td width="60px">
                <img class="avatar" alt="" src="<?php echo $story["user_image"];?>" />
            </td>
            <td>
                <a class="menu" href="<?php echo $baseUrl .'/community/story/detail?id='.$story["_id"]; ?>"><?php echo $story["title"]; ?></a>
               <br/><br/>
               <div style="float:left;">
                   <?php echo 'Viết vào lúc '.$story["date"]; ?>
               </div>
               <div style="float:right;">
                   <?php
                       if((int)$story["view"] >0)
                           echo $story["view"].' lượt xem';
                       if((int)$story["sumcomment"] >0)
                           echo ' | '.$story["view"].' lời bình ';
                   ?>
               </div>
            </td>
        </tr>
        <?php
            }
        ?>
    </table>
</div>
<div class="clear"></div>